package com.kk.app.utils;

import java.util.Iterator;
import java.util.List;
import java.util.Objects;

public class CollectionsHelper{




    public static <T> boolean RemoveIf(List<T> list1, IPredicate<T> filter)
    {
        Objects.requireNonNull(filter);
        boolean removed = false;
        final Iterator<T> each = list1.iterator();
        while (each.hasNext()) {
            if (filter.test(each.next())) {
                each.remove();
                removed = true;
            }
        }
        return removed;
    }

}
